Several mechanical changes to make CentOS less whiney during a build.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 21 Feb 2013 07:07:00 +0000 (07:07 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 21 Feb 2013 07:07:00 +0000 (07:07 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4319 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/garmin_fs.cc
gpsbabel/gbser.cc
gpsbabel/gpilots.cc
gpsbabel/mmo.cc
gpsbabel/skytraq.cc
gpsbabel/teletype.cc

index 58dd64b516c479c5061634426b63d37c89f7ef8b..f75afe53d1fc0f122fc121fb4b5afa012113be15 100644 (file)
@@ -232,12 +232,6 @@ garmin_fs_xml_fprint(gbfile* ofd, const waypoint* waypt,
     writer.writeAttribute("xsi:schemaLocation", 
       "http://www.garmin.com/xmlschemas/GpxExtensions/v3 "
       "http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd");
-//     "http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"
-//     "xmlns:gpxx=\"" \
-//     "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " \
-//     "xsi:schemaLocation=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3 " \
-//     "http://www.garmin.com/xmlschemas/GpxExtensions/v3/GpxExtensionsv3.xsd"
-//     writer.writeEndElement();
 #endif
     if WAYPT_HAS(waypt, proximity) {
       gbfprintf(ofd, "%*s<gpxx:Proximity>%.6f</gpxx:Proximity>\n", space * 2, "", waypt->proximity);
@@ -280,8 +274,9 @@ garmin_fs_xml_fprint(gbfile* ofd, const waypoint* waypt,
       gbfprintf(ofd, "%*s</gpxx:Categories>\n", --space * 2, "");
     }
     if (*addr) {
-      char* str, *tmp;
+      char* str;
 #if OLDGPX
+      char* tmp;
       gbfprintf(ofd, "%*s<gpxx:Address>\n", space++ * 2, "");
 #else
       writer.writeStartElement("gpxx:Address");
@@ -318,10 +313,10 @@ garmin_fs_xml_fprint(gbfile* ofd, const waypoint* waypt,
 #if OLDGPX
         tmp = xml_entitize(str);
         gbfprintf(ofd, "%*s<gpxx:Country>%s</gpxx:Country>\n", space * 2, "", tmp);
+        xfree(tmp);
 #else
       writer.writeTextElement("gpxx:Country", str);
 #endif
-        xfree(tmp);
       }
       if ((str = GMSD_GET(postal_code, NULL))) {
 #if OLDGPX
index 9cb2fc9a91af3df293648fd97505482fb431fb93..cecaa6c72ef59f97333a727a87a52154e98d4f45 100644 (file)
@@ -68,7 +68,7 @@ static int parity_letter(char c)
 int gbser_setup(void* handle, const char* spec)
 {
   unsigned arg[] = { 4800, 8, 0, 1 };
-  int ap;
+  unsigned int ap;
 
   for (ap = 0; ap < sizeof(arg) / sizeof(arg[0]); ap++) {
     unsigned t = 0;
index 9abf748fbf0a0295f718abdce51d57a0af61cf99..56938403e609719e0c9f41f321dbf587a270357e 100644 (file)
@@ -219,7 +219,7 @@ data_read(void)
     int trk_num = 0;
     int trk_seg_num = 1;
     char trk_seg_num_buf[10];
-    char* trk_name = "";
+    const char* trk_name = "";
 
     wpt_tmp = waypt_new();
 
index d46ba9ace34fd6bbfb179b7df202fcbeb91eadc7..c879d562b979014cf5fb834a8277dc3efd176403 100644 (file)
@@ -173,7 +173,7 @@ static char*
 mmo_readstr(void)
 {
   char* res;
-  int len;
+  unsigned int len;
 
   len = (unsigned)gbfgetc(fin);
   if (len == 0xFF) {
@@ -185,7 +185,7 @@ mmo_readstr(void)
       // length is number of "characters" not number of bytes
       len = (unsigned)gbfgetc(fin);
       if (len > 0) {
-        int ii, jj, ch, resbytes=0;
+        unsigned int ii, jj, ch, resbytes=0;
         res = (char *) xmalloc(len*2 + 1); // bigger to allow for utf-8 expansion
         for (ii=0; ii<len; ii++) {
           char utf8buf[8];
@@ -228,7 +228,7 @@ mmo_fillbuf2(void* buf, const gbsize_t bufsz, const gbsize_t count, const int ne
 {
   gbsize_t res;
 
-  if (count > (int)bufsz) {
+  if (count > (unsigned int)bufsz) {
     fatal(MYNAME ": Internal error (bufsz too small)!\n");
   }
 
index f9a2f7102ef54d63dffdb164392ec8af718ce78e..afddbc9ded4de384e64b67588aba46ba9c0a5880 100644 (file)
@@ -203,7 +203,7 @@ rd_buf(const gbuint8 *buf, int len)
   return res_OK;
 }
 
-static int
+static unsigned int
 rd_word(void)
 {
   int errors = 5;              /* allow this many errors */
@@ -257,11 +257,11 @@ skytraq_calc_checksum(const unsigned char *buf, int len)
 }
 
 static int
-skytraq_rd_msg(const void *payload, int len)
+skytraq_rd_msg(const void *payload, unsigned int len)
 {
   int errors = 5;              /* allow this many errors */
-  int c, i, state;
-  int rcv_len, calc_cs, rcv_cs;
+  unsigned int c, i, state;
+  unsigned int rcv_len, calc_cs, rcv_cs;
 
   for (i = 0, state = 0; i < RETRIES && state < sizeof(MSG_START); i++) {
     c = rd_char(&errors);
@@ -480,7 +480,7 @@ skytraq_get_log_buffer_status(gbuint32 *log_wr_ptr, gbuint16 *sectors_free, gbui
     gbuint8 sectors_free[2];
     gbuint8 sectors_total[2];
   } MSG_LOG_STATUS_OUTPUT;
-  int rc;
+  unsigned int rc;
 
   if ((rc = skytraq_wr_msg_verify(&MSG_LOG_STATUS_CONTROL, 1)) != res_OK) {    /* get memory status */
     db(1, MYNAME ": Error sending LOG STATUS CONTROL message (%d)\n", rc);
@@ -769,7 +769,7 @@ skytraq_read_single_sector(unsigned int sector, gbuint8 *buf)
 {
   gbuint8 MSG_LOG_SECTOR_READ_CONTROL[2] = { 0x1B, (gbuint8)(sector) };
   int errors = 5;              /* allow this many errors */
-  int c, i, j, cs;
+  unsigned int c, i, j, cs;
   gbuint8 buffer[16];
 
   if (sector < 0  ||  sector > 0xFF) {
@@ -856,11 +856,11 @@ skytraq_read_single_sector(unsigned int sector, gbuint8 *buf)
 }
 
 static int
-skytraq_read_multiple_sectors(int first_sector, int sector_count, gbuint8 *buf)
+skytraq_read_multiple_sectors(int first_sector, unsigned int sector_count, gbuint8 *buf)
 {
   gbuint8 MSG_LOG_READ_MULTI_SECTORS[5] = { 0x1D };
   gbuint8 *buf_end_tag;
-  int cs, i, read_result;
+  unsigned int cs, i, read_result;
 
   if (first_sector < 0  ||  first_sector > 0xFFFF) {
     fatal(MYNAME ": Invalid sector number (%i)\n", first_sector);
@@ -1128,7 +1128,7 @@ static void
 skytraq_set_location(void)
 {
   double lat, lng;
-  int i;
+  unsigned int i;
   gbuint8 MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
   gbuint8 MSG_GET_LOCATION = 0x35;
 
@@ -1338,7 +1338,7 @@ static const char *poinames[] = {
 #define NUMPOI (sizeof poinames/sizeof poinames[0])
 int getPoiByName(char *name)
 {
-  int i;
+  unsigned int i;
   for (i=0; i<NUMPOI; i++) {
     if (strcmp(poinames[i], name) == 0) {
       return i;
@@ -1374,7 +1374,7 @@ static void miniHomer_get_poi()
 {
   gbuint8 MSG_GET_POI[3] = { 0x4D, 0, 0};
   gbuint8 buf[32];
-  int poi;
+  unsigned int poi;
   double lat, lng, alt;
   double ecef_x, ecef_y, ecef_z;
   waypoint *wpt;
index 12d19001da9134bbcee2f33a24c349af0e8beca2..2026da71b5ba9815fbdb7de8ecd4f379f01f2fd2 100644 (file)
@@ -57,7 +57,7 @@ teletype_rd_deinit(void)
 static void
 teletype_read(void)
 {
-  int i;
+  gbuint32 i;
   for (i = 0; i < tty_wpt_count; i++) {
     waypoint* wpt = waypt_new();
     wpt->shortname = (gbfgetcstr(fin));